#ifndef CSTRTOOL_H_
#define CSTRTOOL_H_

#include <list>
#include <string>
#ifdef __cplusplus
extern "C"{
#endif

class CStrTool {
public:
    static std::string trim(const std::string& str);
    static int split(const std::string& str, std::list<std::string>& ret, std::string sep);
    static std::string replace(const std::string& str, const std::string& src, const std::string& dest);
    static std::string value(std::string src, std::string sep = "\"");
    static unsigned long long char2uint64(char *p);
    static void int2charpoint(int n, unsigned char *p);
    static long long charpoint2longlong(char *p);
    static void short2charpoint(short n, unsigned char *p);
    static unsigned int charpoint2int(char *p);
    static unsigned short charpoint2short(char *p);
};
#ifdef __cplusplus
}
#endif
#endif /* CSTRTOOL_H_ */
